Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arcblock/mcrypto

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcblock/mcrypto

Crypto lib that provides signer,crypter,hasher interface

  • 0.27.12
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
105
increased by45.83%
Maintainers
1
Weekly downloads
 
Created
Source

@arcblock/mcrypto

Forge mcrypto implementation for javascript, just a wrapper around existing javascript crypto libraries.

Usage

npm i @arcblock/mcrypto -S
# OR
yarn add @arcblock/mcrypto

Sign/Verify

const { Signer } = require('@arcblock/mcrypto');

const keyPair = Signer.Ed25519.genKeyPair();
const message = 'some message to sign';
const signature = Signer.Ed25519.sign(message, keyPair.secretKey);
const result = Signer.Ed25519.verify(message, signature, keyPair.publicKey);
assert.ok(result);

Hashing

const { Hasher } = require('@arcblock/mcrypto');

const message = 'message to hash';
const hash = Hasher.SHA2.hash256(message);

Important Note: results from signer and hasher are all hex encoded string

Documentation

For full documentation, checkout README.md.

Implementation

Hasher

  • keccakf1600: crypto-js
  • sha2: crypto-js
  • sha3: jssha3

Signer

  • ed25519: tweetnacl
  • secp256k1: elliptic

Crypter

  • aes-cbc-256: crypto-js

Keywords

FAQs

Package last updated on 28 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc